<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/goods/Good_Thing.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/goods/Good_Thing.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Goodsid',
                footer: "Foots",
                cnName: '商品管理',
                name: 'goods/Good_Thing',
                url: "/Good_Thing/",
                sortName: "Goodsid"
            });
            const editFormFields = ref({"GoodsName":"","GoodsPrice":"","GoodsImg":"","GoodsCode":"","GoodsTypeId":""});
            const editFormOptions = ref([[{"title":"商品名称","field":"GoodsName","type":"text"}],
                              [{"title":"商品价格","field":"GoodsPrice","type":"text"}],
                              [{"title":"商品图片","field":"GoodsImg","type":"img"}],
                              [{"title":"商品编码","field":"GoodsCode","type":"text"}],
                              [{"dataKey":"商品类型下拉框","data":[],"title":"商品类型ID","field":"GoodsTypeId","type":"text"}]]);
            const searchFormFields = ref({"GoodsName":"","GoodsPrice":"","GoodsImg":"","GoodsCode":"","GoodsTypeId":""});
            const searchFormOptions = ref([[{"title":"商品名称","field":"GoodsName","type":"text"},{"title":"商品价格","field":"GoodsPrice","type":"decimal"}],[{"title":"商品图片","field":"GoodsImg"},{"title":"商品编码","field":"GoodsCode"}],[{"dataKey":"商品类型下拉框","data":[],"title":"商品类型ID","field":"GoodsTypeId","type":"select"}]]);
            const columns = ref([{field:'Goodsid',title:'商品ID',type:'int',width:110,readonly:true,require:true,align:'left',sort:true},
                       {field:'GoodsName',title:'商品名称',type:'string',width:110,align:'left'},
                       {field:'GoodsPrice',title:'商品价格',type:'decimal',width:110,align:'left'},
                       {field:'GoodsImg',title:'商品图片',type:'string',width:220,align:'left'},
                       {field:'GoodsCode',title:'商品编码',type:'string',width:110,align:'left'},
                       {field:'GoodsTypeId',title:'商品类型ID',type:'int',bind:{ key:'商品类型下拉框',data:[]},width:80,align:'left'}]);
            const detail = ref({
                cnName: "商品类型",
                table: "Goods_Type",
                columns: [{field:'GoodsTypeId',title:'商品类型ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'GoodsTypeName',title:'商品类型名称',type:'string',width:110,edit:{type:'text'},align:'left',sort:true},
                       {field:'GoodsTypeValue',title:'商品类型值',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'Goodsid',title:'商品ID',type:'int',width:110,edit:{type:'text'},align:'left'}],
                sortName: "GoodsTypeId",
                key: "GoodsTypeId"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
